//
//  WFChannelDetailTitleLabelCollectionViewCell.m
//  FAKER
//
//  Created by Jianwei on 15/11/8.
//  Copyright © 2015年 YHLai. All rights reserved.
//

#import "WFChannelDetailTitleLabelCollectionViewCell.h"

@implementation WFChannelDetailTitleLabelCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createItem];
//        CONTENT_VIEW.backgroundColor = [UIColor yellowColor];
//        self.backgroundColor = [UIColor yellowColor];
    }
    return self;
}
- (void)createItem
{
    _titleLabel = [[BaseClassLabel alloc]init];
    _titleLabel.numberOfLines = 0;
    _titleLabel.font = [UIFont fontWithBold:1 IPhone6sPlus:17 Iphone6s:17 Iphone5s:17 Iphone4s:17];
    [CONTENT_VIEW addSubview:_titleLabel];
    
    _auther_nameLabel = [[BaseClassLabel alloc]init];
    _auther_nameLabel.font = [UIFont fontWithBold:0 IPhone6sPlus:10 Iphone6s:10 Iphone5s:10 Iphone4s:10];
    _auther_nameLabel.textColor = [UIColor lightGrayColor];
    [CONTENT_VIEW addSubview:_auther_nameLabel];
}
- (void)setModel:(WFChannelDetailModel *)model
{
    _model = model;
    
    _titleLabel.text = _model.title;
    
    _auther_nameLabel.text = _model.auther_name;
    
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _titleLableHeight = [Adaptive AdaptiveHeightByString:_titleLabel.text Width:CONTENT_VIEW.WIDTH - 22 FontSize:_titleLabel.font.pointSize];
    
    _titleLabel.frame = CGRectMake(10, CONTENT_VIEW.center.y - _titleLableHeight / 2 - 10, CONTENT_VIEW.WIDTH - 20, _titleLableHeight);
    
    _auther_nameLabel.frame = CGRectMake(_titleLabel.X, _titleLabel.Y + _titleLabel.HEIGHT, _titleLabel.WIDTH, 20);
    
//    _titleLabel.frame = CGRectMake(5, 5, CONTENT_VIEW.WIDTH - 10, CONTENT_VIEW.HEIGHT - 30);
//    
//    _auther_nameLabel.frame = CGRectMake(_titleLabel.X, _titleLabel.Y + _titleLabel.HEIGHT + 2, _titleLabel.WIDTH, 20);
}
@end
